package cn.ssm.biz.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.ssm.biz.RepairlistBiz;
import cn.ssm.dao.RepairlistMapper;
import cn.ssm.pojo.Pager;
import cn.ssm.pojo.Repairlist;
import cn.ssm.query.RepairCountQuery;
import cn.ssm.query.RepairlistQuery;

@Service("RImpl")
public class RepairListBizImpl implements RepairlistBiz {
	@Autowired
	@Qualifier("RepairlistMapper")
	private RepairlistMapper rlm;

	public RepairlistMapper getRlm() {
		return rlm;
	}

	public void setRlm(RepairlistMapper rlm) {
		this.rlm = rlm;
	}

	@Override
	public int addrepairlist(Repairlist r) {
		return rlm.insertrepairlist(r);
	}

	@Override
	public List<Repairlist> findRepairlist() {
		// TODO Auto-generated method stub
		return rlm.selRepairlist();
	}

	@Override
	public Repairlist findRepairlistId(int id) {
		// TODO Auto-generated method stub
		return rlm.selRepairlistId(id);
	}

	@Override
	public int updateLId(Repairlist repairlist) {
		// TODO Auto-generated method stub
		return rlm.updateRId(repairlist);
	}

	@Override
	public int delId(int id) {
		// TODO Auto-generated method stub
		return rlm.delRId(id);
	}

	@Override
	public List<RepairlistQuery> findRepairlistQuery(Pager pager,int computerroonId) {
		// TODO Auto-generated method stub
		int form =(pager.getCurrentPage()-1)*(pager.getRowPerPage());
		return rlm.selRepairlistQuery(form, pager.getRowPerPage(),computerroonId);
	}

	@Override
	public int findRepairlistCount() {
		// TODO Auto-generated method stub
		return rlm.selRepairlistCount();
	}
	
	@Override
	public int selRepairlistComputerroomIdCount(Integer computerroomId) {
		// TODO Auto-generated method stub
		return rlm.selRepairlistComputerroomIdCount(computerroomId);
	}

	@Override
	public List<RepairlistQuery> findRepairlistQueryFaultName(Pager pager,int computerId,
			int computerroomId) {
		int form =(pager.getCurrentPage()-1)*(pager.getRowPerPage());
		return rlm.selRepairlistQueryFaultName(form, pager.getRowPerPage(),computerId, computerroomId);
	}
	
	
	@Override
	public int selRepairlistQueryFaultNameCount(int computerId,int computerroomId) {
	
		return rlm.selRepairlistQueryFaultNameCount(computerId, computerroomId);
	}
	
	
	@Override
	public List<RepairlistQuery> selectOneComputerStatusByCId(int computerId,
			int computerroomId) {
		// TODO Auto-generated method stub
		return rlm.selectOneComputerStatusByCId(computerId, computerroomId);
	}

	@Override
	public List<RepairlistQuery> selectroomStatusByroomId(int computerroomId) {
		// TODO Auto-generated method stub
		return rlm.selectroomStatusByroomId(computerroomId);
	}


	@Override
	public List<RepairCountQuery> getCountByFaultIdAndClassId(Integer faultId,
			Integer statusId, String beginFaultTime, String endFaultTime,
			String classroomId) {
	
		return rlm.selectCountByFaultIdAndClassId(faultId, statusId, beginFaultTime, endFaultTime, classroomId);
	}

	
	
	
	@Override
	public List<RepairCountQuery> selectCountByFaultId(Integer computerroomId,
			Integer faultId, Integer statusId, String beginFaultTime,
			String endFaultTime, Integer  classroomId) {
		
		return rlm.selectCountByFaultId(computerroomId, faultId, statusId, beginFaultTime, endFaultTime, classroomId);
	}
	

	@Override
	public List<Repairlist> findRepairlistAllByComputerroomId(Integer computerroomId) {
		// TODO Auto-generated method stub
		return rlm.selRepairlistAllByComputerroomId(computerroomId);
	}

	@Override
	public Integer selRepairlistIsOne(Integer faultId, Integer computerroomId, Integer computerId) {
		// TODO Auto-generated method stub
		return rlm.selRepairlistIsOne(faultId, computerroomId, computerId);
	}

	@Override
	public List<RepairCountQuery> selectCountByFaultId4(Integer computerroomId,
			Integer faultId, Integer statuId, String beginFaultTime,
			String endFaultTime, Integer classroomId) {
		// TODO Auto-generated method stub
		return rlm.selectCountByFaultId4(computerroomId, faultId, statuId, beginFaultTime, endFaultTime, classroomId);
	}


	

	
	



}
